<?php
/**
向客户端输出所有的产品信息，以JSON格式
**/
header('Content-Type: application/json;charset=UTF-8');

require('0_init.php');

$sql = "SELECT * FROM jd_product";
$result = mysqli_query($conn, $sql);

//DQL: false 或 结果集

$list = mysqli_fetch_all($result, MYSQLI_ASSOC);

echo json_encode($list);